﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using KVB.Common;
using Customer_Profile.eCard.DBDao;
using Customer_Profile.Admin;

namespace Customer_Profile.eCard.Reward
{
    public partial class Deal_Reward_detail : System.Web.UI.Page
    {
        string strUserName = "";
        string strUserID = "";
        string strEntity = "";
        int reward_id;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request["reward_id"] != null)
            {
                reward_id = int.Parse(Request["reward_id"].ToString());
            }

            Comm.CheckSession(this.Page, "/login.aspx", "usermodel");
            if (Session["usermodel"] != null)
            {
                strUserID = ((UserInfoEntity)Session["usermodel"]).UserLoginId;
                strUserName = ((UserInfoEntity)Session["usermodel"]).UserName;
                strEntity = ((UserInfoEntity)Session["usermodel"]).UserOffice;
            }
            else
            {
                Log.WriteDefaultLog("main_01 Page_Load", "Session is null");
                return;
            }
            if (!Page.IsPostBack)
            {

                bindGrid();
            }
        }

        private void bindGrid()
        {
            try
            {
                DataSet ds = RewardDao.RewardDetailByRewardID(reward_id);
                gridReward.DataSource = ds;
                gridReward.DataBind();
            }
            catch (Exception ex)
            {
                KVB.Common.Log.WriteDefaultLog("Reward.bindGrid", ex.ToString());
            }
        }
    }
}